package com.linwen.excise.leetcode;

/**
 * @ClassName _389找不同
 * @Description TODO
 * @Author zero
 * @DATE 2024/9/28 5:17 PM
 * @Version 1.0
 */
public class _389找不同 {
    public static void main(String[] args) {
        _389找不同 inst = new _389找不同();
        String s = "abcd", t = "abcde";
        System.out.println(inst.findTheDifference(s,t));

    }
    public char findTheDifference(String s, String t) {
        int sum1 = 0,sum2 = 0;
        for (int i = 0; i < s.length(); i++) {
            sum1 += s.charAt(i);
        }
        for (int i = 0; i < t.length(); i++) {
            sum2 += t.charAt(i);
        }
        return (char)(sum2-sum1);
    }
}
